<template>
  <div>
    <svg-icon
      :iconClass="bol ? 'fullscreen' : 'exit-fullscreen'"
      @click="toggle"
    ></svg-icon>
    <svg-icon iconClass="" @click="toggle"></svg-icon>
  </div>
</template>

<script>
import Screenfull from 'screenfull'
export default {
  name: 'FullScreen',
  data () {
    return {
      bol: true
    }
  },
  methods: {
    toggle () {
      console.log(Screenfull)
      if (Screenfull.isEnabled) {
        Screenfull.toggle()
        this.bol = !this.bol
      } else {
        this.$message.error('该浏览器不支持全屏切换')
      }
    }
  }
}
</script>

<style></style>
